package com.molichuxing.services.property;

/**
 * 
 * 接收类型(1：邮件收件人，2：邮件抄送人，3：电话短信接收人)
 */
public enum RiskEmailReceiveTypeEnum {

	/**
	 * 邮件收件人
	 */
	EMAIL_RECIPIENT(1, "邮件收件人"),
	/**
	 * 邮件抄送人
	 */
	EMAIL_COPY(2, "邮件抄送人"),
	
	/**
	 * 电话短信接收人
	 */
	PHONE_SMS(3, " 电话短信接收人"),

	/**
	 * 钉钉webhook
	 */
	DINGTALK_WEBHOOK(4, " 钉钉webhook");


	int value;
	String name;

	RiskEmailReceiveTypeEnum(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}


	/**
	 * 通过value获取枚举的name
	 * 
	 * @param value
	 * @return
	 */
	public static String getName(int value) {
		RiskEmailReceiveTypeEnum enumerate = getEnum(value);
		return enumerate == null ? null : enumerate.getName();
	}

	/**
	 * 通过value获取枚举
	 * 
	 * @param value
	 * @return
	 */
	public static RiskEmailReceiveTypeEnum getEnum(int value) {
		for (RiskEmailReceiveTypeEnum enumerate : RiskEmailReceiveTypeEnum.values()) {
			if (enumerate.getValue() == value) {
				return enumerate;
			}
		}
		return null;
	}
}
